<%--
    Document   : index
    Created on : Jul 7, 2011, 1:23:40 AM
    Author     : Thanhluan216
--%>

<%@page import="server.process.ProcessBeanLocal"%>
<%@page import="server.entity.Category"%>
<%@page import="javax.naming.Context"%>
<%@page import="javax.naming.InitialContext"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<jsp:include page="header.jsp"></jsp:include>
            <div id="main">
                <div id="slidebar">
                    <div id="login">
                        <jsp:include page="login.jsp"></jsp:include>
                    </div>
                    <div id="search">
                        <jsp:include page="search.jsp"></jsp:include>
                    </div>
                    <div id="product">
                        <jsp:include page="categorypanel.jsp"></jsp:include>
                    </div>
                </div>
                <div id="content">
                    <a href="#">Home</a>-><a href="#">My Collection</a><br/>
                    
                    <table border="0">
                        <tr>
                            <%
                            Context ctx = new InitialContext();
                            ProcessBeanLocal local = (ProcessBeanLocal) ctx.lookup("ProcessLocalJNDI");
                            String username =(String) session.getAttribute("username");
                            Category[] arrCategorys = local.getListCollection(username, true);
                                        for (int i = 0; i < arrCategorys.length; i++) {                                           
                            %>
                            <td>   <h2> <%=arrCategorys[i].getCollectionName()%></h2>
                                    <img alt=""  src="CategoryImage/<%=arrCategorys[i].getImage()%>" height="150" width="200"/><br/>
                                    <a href="viewCategory.jsp?id=<%= arrCategorys[i].getCollectionID() %>">Add photo</a>
                                    <a href="controlertuan?id=<%= arrCategorys[i].getCollectionID() %>&action=viewPhotoinCategory">view inside</a>
                            </td>
                            <%}%>

                        </tr>
                    </table>
                            <a href="newCollection.jsp">create new collection</a>
                </div>
            </div>
            <div id="footer">

            </div>
        </div>
    </body>
</html>

